﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ModbusTestTool
{
    class TypeAdapter
    {
        private TypeAdapter() { }
        
        

        static public BaseRegister SetupTypemapFields(string inParamName, int inRegister, paramType inType)
        {
            switch (inType)
            {
                case paramType.float_t:     return new FloatInvType(inParamName, inRegister);
                case paramType.word_t:      return new Uword(inParamName, inRegister);
                case paramType.long_t:      return new ULongInv(inParamName, inRegister);
                case paramType.float_i_t:   return new FloatType(inParamName, inRegister);
                case paramType.sword_t:     return new SWord(inParamName, inRegister);
                default:                    return new Uword(inParamName, inRegister);

            }
        }
    }
}
